class Foo:
    __instance = None
    __is_inited = False

    def __new__(cls, *args, **kwargs):
        if cls.__instance == None:
            cls.__instance = object.__new__(cls)
        return cls.__instance

    def __init__(self, name):
        if not self.__is_inited:
            self.name = name
            self.__is_inited = True


for i in range(10):
    f = Foo("Foo#{}".format(i))
    print(id(f), f.name)
